#include <iostream>
#include<vector>
#include<algorithm>
using namespace std;
bool cmp(vector<int>&a,vector<int>&b){
    if(a[0]!=b[0]) return a[0]>b[0];
    else return a[1]<b[1];
}
int main()
{
    vector<vector<int> > intervals(10);
	for (int i = 0; i < 10; i++)
	{
		for (int j = 0; j < 3; j++)
		{
			intervals[i].push_back(rand() % 100);
		}
	}
	for (int i = 0; i < 10; i++)
	{
		for (int j = 0; j < 3; j++)
		{
			cout<<intervals[i][j]<<" ";
		}
		cout<<endl;
	}
	sort(intervals.begin(),intervals.end(),cmp);
	cout<<"-------------------------------"<<endl;
	for (int i = 0; i < 10; i++)
	{
		for (int j = 0; j < 3; j++)
		{
			cout<<intervals[i][j]<<" ";
		}
		cout<<endl;
	}
    return 0;
}


